def main():
    y_or_n = input("是否退出程序（y/n)?")
    while y_or_n != "y":
        gender=input("性别：")
        print(type(gender))
        weight=float(input("体重："))
        height=float(input("身高："))
        age=int(input("年龄："))
        if gender=="男":
            bmr=(13.7*weight)+(5*height)-(6.8*age)+66
        elif gender=='女':
            bmr=(9.6*weight)+(1.8*height)-(1.7*age)+655
        else:
            bmr=-1
        if bmr !=-1:
            print("基础代谢率：", bmr)
        else:
            print('暂不支持')
        print()
        y_or_n = input("是否退出程序（y/n)?")
if __name__ == '__main__':
     main()

